﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Entities;
using DAL;

namespace SurveyGUI
{
    public partial class AddQuestionForm : Form
    {
        IQuestionRepository rep = new QuestionRepository();
        public AddQuestionForm()
        {
            InitializeComponent();
        }

        private void btnHuy_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (txtcauhoi.Text != "")
            {
                Question q = new Question();
                q.MoTa = txtcauhoi.Text;
                rep.AddQuestion(q);
                //load
                this.Close();
            }
            else
            {
                MessageBox.Show("Bạn chưa điện thông tin câu hỏi:");
            }

            
        }

    }
}
